<!-- 时间日期搜索 -->
<template>
	<div >
		<el-row class="search">
			<el-col :span="3">
				<div class="grid-content bg-purple" style="font-size: 22px;line-height: 40px;">优惠券有效期:</div>
			</el-col>
			<el-col :span="5">
				<div class="grid-content bg-purple-light">
					<el-date-picker
						style="width: 270px;"
						format="yyyy-MM-dd"
						v-model="form.getTime"
						value-format="yyyy-MM-dd"
						type="daterange"
						range-separator="至"
						start-placeholder="开始日期"
						end-placeholder="结束日期"
					></el-date-picker>
				</div>
			</el-col>
			<el-col :span="3">
				<div class="grid-content bg-purple">
					<el-select style="width: 150px;" v-model="form.type" placeholder="请选择"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select>
				</div>
			</el-col>
			<el-col :span="3">
				<div class="grid-content bg-purple">
					<el-select style="width: 150px;" v-model="form.statu" placeholder="请选择"><el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select>
				</div>
			</el-col>
			<el-col :span="4">
				<div class="grid-content bg-purple"><el-input style="width: 190px;" v-model="form.archName" placeholder="请输入券名称"></el-input></div>
			</el-col>
			<el-col :span="4" v-if="type!=2">
				<div class="grid-content bg-purple">
					<el-input style="width: 250px;" placeholder="请输入手机号、客户姓名" v-model="form.users">
							<el-button slot="append" type="primary" style="background-color: #409EFF;color: #fff;" icon="el-icon-search" @click="search"></el-button>
					</el-input>
				</div>
			</el-col>
		</el-row>
	</div>
</template>

<script>
export default {
	props:{
		type:Number
	},
	data() {
		return {
			form: {
				// 开始结束时间
				getTime: '',
				
				// 类型
				type: '1',

				//状态
				statu: '1',

				//券名称
				archName: '',

				//客户姓名,电话
				users: ''
			},
			options: [{ label: '全部券类型', value: '1' }, { label: '立减', value: '2' }, { label: '满减', value: '3' }, { label: '折扣', value: '4' }],
			options2: [
				{ label: '全部状态', value: '1' },
				{ label: '未使用', value: '2' },
				{ label: '已使用', value: '3' },
				{ label: '已过期', value: '4' },
				{ label: '已失效', value: '5' }
			]
		};
	},
	computed: {},
	methods: {
		/**
		 * 搜索
		 */
		search() {
			this.$emit('search',this.form);
		}
	},
	mounted() {},
	created() {} //生命周期 - 创建之后
};
</script>

<style scoped>
	.search{
		margin-left: 27px;
	}
</style>
